<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New User Registration Form</title>
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<style type="text/css">
body,td,th {
	color: #FFF;
}
</style>

<script src="jquery.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                $(".uname").change(function(){
                    var uname = $(this).val();
                    if(uname.length > 3){
                        $(".status").html("<img src='images/loading.gif'><font color=gray> Checking availability...</font>");
                         $.ajax({
                            type: "POST",
                            url: "check.do",
                            data: "uname="+ uname,
                            success: function(msg){

                                $(".status").ajaxComplete(function(event, request, settings){
                                     
                                    $(".status").html(msg);

                                });
                            }
                        }); 
                    }
                    else{
                         
                        $(".status").html("<font color=red>username shold be <b>3</b> chars</font>");
                    }
                    
                });
            });
        </script>

</head>
<body>
<div id="header">
	<div id="logo">
		<h1><strong>SMARN - STOCKS</strong></h1>
		<p>&nbsp;</p>
	</div>
	<!-- end #logo -->
	<div id="menu">
		<ul>
			<li class="active"><a href="http://localhost:8080/smarn-stocks/index.jsp">Home</a></li>
			<li><a href="#">About Us</a>
			</li><li><a href="#">Contact Us</a></li>
		</ul>
	</div>
	<!-- end #menu -->
</div>
<!-- end #header -->
<div id="page">
	<div id="content">
	  <div class="post">
	    <h2 class="title">NEW USER REGISTRATION</h2>
		<div class="entry">
		  <p> <form action="user-reg.do" method="post" enctype
="multipart/form-data" name="form1" id="form1">


   <left>
   <table border="0">
       <tr>
	       <td align="right"><b>Name:</td>
		   <td ><input type="text" name="name"></td>
	   </tr>
	   <tr>
	       <td align="right"><b>Username:</td>
		   <td ><input type="text" class="uname"/>&nbsp;<span class="status"></span></td>
		   </tr>
	   <tr>
      	      <tr>
	       <td align="right"><b>Password:</td>
		   <td ><input type="password" name="password"></td>
	   </tr>
       <tr>
	       <td align="right"><b>Re-type Password:</td>
		   <td ><input type="password" name="password"></td>
	   </tr>
       <tr>
	       <td align="right"><b>E-mail:</td>
		   <td ><input type="text" name="email"></td>
	   </tr>	   

       <tr>
	       <td align="right"><b>User Image </td>
	       <td>
		       <input name="file" type="file" id="file"><br/><br/>
		   <td>
	   </tr>
        
		 <left>
         </br>
		 <tr>
		   <td >
               <input type="submit" name="submit" value="Submit"/>
			</td>
		 </tr>
		</left>
    
    </table>
	</Left>
 </form>
          &nbsp;</p>
</div>
	  </div>
  </div>
	<!-- end #content --><!-- end #sidebar -->
</div>
<!-- end #page -->
<div id="footer">
	<p>&copy; 2011. All Rights Reserved.</p>
</div>
<!-- end #footer -->
</body>
</html>
